import request from '@/utils/sendRequest';

export function codeCountList(params = {}) {
  return request({
    url: '/v1/app/code-count/list',
    method: 'post',
    data: params,
  });
}

export function codeCountListByBranchId(params = {}) {
  return request({
    url: '/v1/app/code-count/list-by-branch',
    method: 'post',
    data: params,
  });
}

export function getGroupSummaryByBranchId(params = {}) {
  return request({
    url: '/v1/app/code-count/branch/group-summary',
    method: 'post',
    data: params,
  });
}

export function getBranchSummaryByBranchId(params = {}) {
  return request({
    url: '/v1/app/code-count/branch-summary',
    method: 'post',
    data: params,
  });
}

export function getcodeCountSummary(params = {}) {
  return request({
    url: '/v1/app/code-count/summary',
    method: 'post',
    data: params,
  });
}

export function codeCountComplement(params = {}) {
  return request({
    url: '/v1/app/static/count-repos',
    method: 'post',
    data: params,
  });
}

export function isApplyCodeCountDeleteFlag(id) {
  return request({
    url: `/v1/app/code-count/list/${id}`,
    method: 'delete',
  });
}

export function getQuarterList() {
  return request({
    url: '/v1/app/code-count/quarter-list',
    method: 'post',
  });
}

export function previewEmail(nyrDate) {
  return request({
    url: `/v1/app/preview-email/${nyrDate}`,
    method: 'get',
  });
}
